#include <iostream>
using namespace std;
int a[100001],b[100001];
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n;
    cin>>n;
    int ans=n;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    int x=0,y=0;
        for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            if(a[i]>a[j]){
                int k=a[i];
                a[i]=a[j];
                a[j]=k;
            }
        }
    }
    x=a[0];
    int c=0;
    int add=0;
    while(y<=a[n]){
         for(int i=0;i<n;i++){
            if(a[i!=0]&&a[i]<x){
                x=a[i];
            }
             if(a[i]>x){
                y=a[i];
                c=1;
            }
            if(x!=0&&y==0){
                add++;
            }

            if(c==1){
               if(b[i]==0&&a[i-add]!=0){
                b[i]=1;
                ans-=1;
                c=0;
                if(a[i-add]==a[i-add+1])
                    x=a[i-add+1];
               }
               if(a[i-add]<a[i-add+1]){
                x=y;
               }
            }
           }
    }
    cout<<ans;
    fclose(stdin);
    fclose(stdout);
    return 0;
}
